
namespace gen {

	template <class CompositorT1, class CompositorT2>
	template <typename IteratorT>
	class or_expr<CompositorT1,CompositorT2>::or_expr_initializator 
	{
	private:
		domain<IteratorT> m_domain1;
		domain<IteratorT> m_domain2;
		
	public:
		or_expr_initializator(	domain<IteratorT> const& domain1,
								domain<IteratorT> const& domain2)
		: m_domain1(domain1), m_domain2(domain2) 
		{}

		bool operator()(IteratorT const& i)
		{
			return (m_domain1.point(i) || m_domain2.point(i));
		}
	};

	template <class CompositorT1, class CompositorT2>
	template <typename ContextT>
	domain<typename ContextT::iterator_t>
	or_expr<CompositorT1,CompositorT2>::evaluate(ContextT const& c) const
	{
		typedef typename ContextT::iterator_t iterator_t;
		typedef or_expr_initializator<iterator_t> initializator_t;
		initializator_t init(expr1.evaluate(c), expr2.evaluate(c));
		domain<iterator_t> result(c.domain().first(), c.domain().last(), init);
		return result;
	}

	template <class DerivedT>
	inline or_expr<cst_expr, DerivedT>
	operator||(bool value, const cond_expr<DerivedT> & other)
	{
		return or_expr<cst_expr, DerivedT>(cst_expr(value), other);
	}

}
